evl_View = CreateFrame("Frame", nil, UIParent)

BINDING_HEADER_EVL_VIEW = "Evl's View";

local ShowRightBar = function()
	MultiBarRight:SetAlpha(1)
end

local HideRightBar = function()
	MultiBarRight:SetAlpha(0)
end

function evl_View:new()
	self:SetScript("OnEvent", self.onEvent)

	self:RegisterEvent("PLAYER_ENTERING_WORLD")

	UIPARENT_MANAGED_FRAME_POSITIONS["MultiBarRight"] = {baseX = -5, reputation = 1, anchorTo = "UIParent", point = "RIGHT", rpoint = "RIGHT"}
	
	MainMenuBarLeftEndCap:Hide()
	MainMenuBarRightEndCap:Hide()

	MultiBarLeft:SetScale(.8)
	MultiBarRight:ClearAllPoints()
	MultiBarRight:SetScale(.8)
	MultiBarRight:SetAlpha(0)
	MultiBarRight:EnableMouse(true)
	MultiBarRight:SetScript("OnEnter", ShowRightBar)
	MultiBarRight:SetScript("OnLeave", HideRightBar)
	
	for i=1, NUM_MULTIBAR_BUTTONS do
		local button = getglobal("MultiBarRightButton"..i)
		button:SetScript("OnEnter", ShowRightBar)
		button:SetScript("OnLeave", HideRightBar)
	end
	
	self:hide()
end

function evl_View:onEvent()
	self:hide()
end

function evl_View:hide()
	MainMenuBar:SetPoint("BOTTOM", UIParent, "BOTTOM", 0, -1000)
	
	MultiBarBottomLeft:Hide()
	MultiBarBottomRight:Hide()
	
	MultiBarLeft:Hide()
	hidden = true
end

function evl_View:show()
	MainMenuBar:SetPoint("BOTTOM", UIParent, "BOTTOM", 0, 114)

	MultiBarBottomLeft:Show()
	MultiBarBottomRight:Show()
	MultiBarLeft:Show()
	hidden = false
end

function evl_View:toggle()
	if hidden then
		self:show()
	else
		self:hide()
	end
end

evl_View:new()